﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using WMS.BasicData.Clients;
using WMS.Pagination;
using WMS.WarehousingManagement.PurchaseDetailss;

namespace WMS.Web.Controllers.WarehousingManagement.PurchaseDetailss
{
    public class PurchaseDetailsController : Controller
    {

        /// <summary>
        /// 进货商品详情服务接口
        /// </summary>
        private readonly IPurchaseDetailsAppService _purchaseDetailsAppService;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="purchaseDetailsAppService">商品进货详情服务接口</param>
        public PurchaseDetailsController(IPurchaseDetailsAppService purchaseDetailsAppService)
        {
            _purchaseDetailsAppService = purchaseDetailsAppService;
        }

        /// <summary>
        /// 显示视图
        /// </summary>
        /// <returns>跳转到视图</returns>
        public IActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 显示进货通知明细信息
        /// </summary>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">页容量</param>
        /// <param name="orderName">商品名称</param>
        /// <returns>返回结果</returns>
        [HttpGet]
        public async Task<PageResult> GetInquire(int pageIndex, int pageSize, string? orderName)
        {
            var list = await _purchaseDetailsAppService.GetInquire(pageIndex, pageSize, orderName);
            return list;
        }
    }
}
